﻿using University.Workshop.Model;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace University.Workshop.Tests
{
    
    
    /// <summary>
    ///This is a test class for BankAccountTest and is intended
    ///to contain all BankAccountTest Unit Tests
    ///</summary>
    [TestClass()]
    public class BankAccountTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for ChangeAmount
        ///</summary>
        [TestMethod()]
        public void ChangeAmountTest()
        {
            PokerServer server = new PokerServer();
            server.InitializeServer(3000);

            BankAccount target = new BankAccount(); // TODO: Initialize to an appropriate value
            string numberCard = "4"; // TODO: Initialize to an appropriate value
            string amount = "100"; // TODO: Initialize to an appropriate value
            string operation = "sum"; // TODO: Initialize to an appropriate value
            string name = "Roberto"; // TODO: Initialize to an appropriate value
            string expected = "true"; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.ChangeAmount(numberCard, amount, operation, name);
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
            server.DisconnectServer();
        }

        /// <summary>
        ///A test for RegisterCreditCard
        ///</summary>
        [TestMethod()]
        public void RegisterCreditCardTest()
        {
            PokerServer server = new PokerServer();
            server.InitializeServer(3000);

            BankAccount target = new BankAccount(); // TODO: Initialize to an appropriate value
            string name = "Roberto"; // TODO: Initialize to an appropriate value
            string numberCard = "4"; // TODO: Initialize to an appropriate value
            string expected = "not"; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.RegisterCreditCard(name, numberCard);
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
            server.DisconnectServer();
        }

        /// <summary>
        ///A test for RegisterCreditCard
        ///</summary>
        [TestMethod()]
        public void RegisterCreditCardTest1()
        {
            PokerServer server = new PokerServer();
            server.InitializeServer(3000);

            BankAccount target = new BankAccount(); // TODO: Initialize to an appropriate value
            string name = "Armando"; // TODO: Initialize to an appropriate value
            string numberCard = "51"; // TODO: Initialize to an appropriate value
            string expected = "ok"; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.RegisterCreditCard(name, numberCard);
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");

            server.DisconnectServer();
        }

        /// <summary>
        ///A test for ConsultLogOn
        ///</summary>
        [TestMethod()]
        public void ConsultLogOnTest()
        {
            PokerServer server = new PokerServer();
            server.InitializeServer(3000);

            BankAccount target = new BankAccount(); // TODO: Initialize to an appropriate value
            string name = "Roberto"; // TODO: Initialize to an appropriate value
            string numberCard = "4"; // TODO: Initialize to an appropriate value
            bool expected = true; // TODO: Initialize to an appropriate value
            bool actual;
            actual = target.ConsultLogOn(name, numberCard);
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
            server.DisconnectServer();
        }

        /// <summary>
        ///A test for ConsultLogOn
        ///</summary>
        [TestMethod()]
        public void ConsultLogOnTest1()
        {
            PokerServer server = new PokerServer();
            server.InitializeServer(3000);

            BankAccount target = new BankAccount(); // TODO: Initialize to an appropriate value
            string name = "Roberto"; // TODO: Initialize to an appropriate value
            string numberCard = "23"; // TODO: Initialize to an appropriate value
            bool expected = false; // TODO: Initialize to an appropriate value
            bool actual;
            actual = target.ConsultLogOn(name, numberCard);
            Assert.AreEqual(expected, actual);
           // Assert.Inconclusive("Verify the correctness of this test method.");

            server.DisconnectServer();
        }

        /// <summary>
        ///A test for Consult
        ///</summary>
        [TestMethod()]
        public void ConsultTest()
        {
            PokerServer server = new PokerServer();
            server.InitializeServer(3000);

            BankAccount target = new BankAccount(); // TODO: Initialize to an appropriate value
            string name = "Miguel"; // TODO: Initialize to an appropriate value
            string cardNumber = "3"; // TODO: Initialize to an appropriate value
            float expected = 200; // TODO: Initialize to an appropriate value
            float actual;
            actual = target.Consult(name, cardNumber);
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
            server.DisconnectServer();
        }

       
    }
}
